local Input = UnityEngine.Input

TankCmp = 
{
	--里面可以放一些属性
	Hp = 100,
	att = 50,
	name = "good tank",
}

function TankCmp:Awake()
	print("TankCmp Awake name = "..self.name );
end
 
function TankCmp:Start()
	print("TankCmp Start name = "..self.name );
end

function TankCmp:Update(gameObject)
	print("TankCmp Update name = "..self.name )

	local horizontal = Input.GetAxis("Horizontal")
	local vertical = Input.GetAxis("Vertical")

	local x = gameObject.transform.position.x + horizontal
	local y = gameObject.transform.position.y + vertical
	gameObject.transform.position = Vector3.New(x, y, 0)
end
 
--创建对象
-- function TankCmp:New(Hp, att)
function TankCmp:New()
	local o = {} 
    setmetatable(o, self)  
	self.__index = self
	-- self.Hp	= Hp
	-- self.att = att
	return o
end  